package com.gk.panda.apis.patrol.commons;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 业务枚举
 *
 * @Author：xxz
 * @Create: 2022/8/15 11:47
 */
@Getter
public class StateEnum {

    /**
     * 巡护类型
     */
    @Getter
    @AllArgsConstructor
    public enum PATROL_TYPE {
        TRANSECT("TRANSECT", "样线巡护"),
        DAILY("DAILY", "日常巡护"),
        OTHER("OTHER", "其他巡护"),
        ;
        private String type;
        private String desc;
        public static PATROL_TYPE getEnum(String type) {
            return Arrays.stream(values()).filter(i -> i.getType().equals(type)).findFirst().get();
        }
    }

    /**
     * 巡护类型
     */
    @Getter
    @AllArgsConstructor
    public enum REPORT_TYPE {
        INSTANT("INSTANT", "即时"),
        PLAIN("PLAIN", "普通"),;
        private String type;
        private String desc;

        public static REPORT_TYPE getEnum(String type) {
            return Arrays.stream(values()).filter(i -> i.getType().equals(type)).findFirst().get();
        }
    }


    /**
     * 返回状态码
     */
    @Getter
    @AllArgsConstructor
    public enum RESULT_CODE{
        OK(200,"ok"),
        ERROR(201,"error")
        ;
        private Integer code;

        private String desc;
    }
    /**
     * 巡护类型
     */
    @Getter
    @AllArgsConstructor
    public enum RESOURCE_TYPE {
        PICTURE("PICTURE", "图片"),
        VIDEO("VIDEO", "视频"),;
        private String type;
        private String desc;

        public static RESOURCE_TYPE getEnum(String type) {
            return Arrays.stream(values()).filter(i -> i.getType().equals(type)).findFirst().get();
        }
    }


    /**
     * 巡护状态
     */
    @Getter
    @AllArgsConstructor
    public enum PATROL_STATE{

        UNDERWAY("UNDERWAY","巡护中"),
        END("END","巡护结束")
        ;
        private String state;

        private String desc;

        public static PATROL_STATE getEnum(String state) {
            return Arrays.stream(values()).filter(i -> i.getState().equals(state)).findFirst().get();
        }
    }


}
